package com.anbang.app.ui.animation

import android.graphics.drawable.Animatable
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.anbang.app.R
import kotlinx.android.synthetic.main.activity_svg.*

class SVGActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_svg)

        animIv.setOnClickListener {
            //动画 是否可播放
            if (animIv.drawable is Animatable) {
                (animIv.drawable as Animatable).start()
            }
        }

        //点击播放svg
        imageView.setOnClickListener {
            //动画 是否可播放
            if (imageView.drawable is Animatable) {
                (imageView.drawable as Animatable).start()
            }
        }
    }
}
